package com.cheung.leetcode.contest.doubleweek.doubleweek133;

import org.junit.jupiter.api.Test;

/**
 * @BelongsProject : java-leetcode
 * @BelongsPackage : com.cheung.leetcode.contest.doubleweek133
 * @Author :  cheungming
 * @CreateTime : 2024-06-30 09:26:55
 * @Description : 第一题
 * @Version : 1.0
 */
public class Code3190Test {

    public int minimumOperations(int[] nums) {
        int sum = 0;
        for (int num : nums) {
            // 一个数mod3只有0,1,2三种选择，其中2可以看作-1，因此
            if (num % 3 != 0) {
                sum++;
            }
        }
        return sum;
    }


    @Test
    public void test1() {
        assert minimumOperations(new int[]{1, 2, 3, 4}) == 3;
    }

    @Test
    public void test2() {
        assert minimumOperations(new int[]{1, 5, 0, 3, 5}) == 3;
    }
}
